﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace TienTeTuong
{
    public partial class Categories : System.Web.UI.Page
    {
        public List<CategoryDTO> lstCate = new List<CategoryDTO>();
        public List<CategoryDetailDTO> lstCateDetail = new List<CategoryDetailDTO>();
        CategoryBUS cateBUS = new CategoryBUS();
        CategoryDetailBUS cateDetailBUS = new CategoryDetailBUS();
        public int maxPerLine;
        public int maxPerLineHot;
        // declare variable paging
        public int iTotalPage;
        public int iCurPage;
        public int iUpperPage;
        public int iLowerPage;
        public int iTotalResult;
        private int page;

        protected void Page_Load(object sender, EventArgs e)
        {
            //Session["IsProductPage"] = "1";
            try
            {
                string strPage = Request.QueryString["page"];
                page = Common.IsNumber(strPage) ? int.Parse(strPage) : 1;
                lstCate = cateBUS.GetListCategoryByPage(page, out iTotalPage, out iCurPage,out iLowerPage,out iUpperPage,out iTotalResult);
                lstCateDetail = cateDetailBUS.GetHotListCategoryDetail();
             
            }
            catch (Exception ex)
            {
                Logger.WriteLog(LogLevel.ERROR,ex +"\n"+ex.StackTrace);
            }
           
            
        }
    }
}